@extends('member.member')

@section('title', '我的课程')

@section('rightcontainer')
<div class="tab-content">
    <div class="my_class" class="member-container">
    	<div class='ent_zhph ent3'>
    		<ul class="mem_cate clearfix">
                <li class='firt-li'>排序方法:</li>
                <li>
                    <a href='/member/course?sort=0' class="@if($sort == 0) ent-bgcolor @endif">时间</a>
                </li>
                <li>|</li>
                <li>
                    <a href='/member/course?sort=1' class="@if($sort == 1) ent-bgcolor @endif">浏览量</a>
                </li>
                <li>|</li>
                <li>
                    <a href='/member/course?sort=2' class="@if($sort == 2) ent-bgcolor @endif">评论数</a>
                </li>
                <div class="clearfix"></div>
    		</ul>
    	</div>
    	@foreach($studys as $st)
		<div class="mem_cont">
			<div class="fl cont_pic" style="margin-bottom: 20px;margin-left: 20px;margin-top: 15px">
				<a href="{{url('/teaches/'.$st->tid)}}">
				    <img src="@if(!empty($st->thumb)){{$st->thumb}}@else{{ asset('/images/front/adriod.png')}}@endif" width="170" height="106">
				</a>
			</div>
			<div class="fl" style="height:25px;line-height: 25px;margin-left:10px;margin-top: 10px;width:730px">
				<div class="list-title" >
					<a href="{{url('/teaches/'.$st->tid)}}"><span class="fl ft-18 cor-2">{{$st->ttname}}</span></a>
					<span class="ft-14 ml-10">{{$st->tcname}}</span><span class="ft-12 ml-10">{{$st->tccname}}</span>
					<span class="fr">
						<a href="javascript:void(0)" onclick="delete_one('/member/course/{{$st->tid}}','{{$st->tid}}','{{csrf_token()}}')"><img src="{{ asset('/images/front/member/trash.png')}}"></a>
					</span>
					<div class="clearfix"></div>
				</div>
				<div class="ft-14 cor-4" style="height:30px;line-height: 30px;margin-top:10px">
					<span class="fl">分类：{{$st->cat_name}}</span>
					<span class="kp_stu fr"><a href="{{url('/teaches/'.$st->tid)}}" style="color:#fff">继续学习</a></span>
					<span class="fr mr-10">{{round($st->chapter_num/$st->chapters,3)*100}}%</span>
					<span class="pro fr mr-10">
				     {{-- <div class="ress" @if($st->finished == 1) style="background: #2fb945!important" @endif></div>--}}
                        @if($st->finished == 1)
                          <div class="ress"></div>
                        @else
                          <div class='ress-bg'>
                            <div id='ress-co'></div>
                          </div>
                        @endif
                    </span>
                    <script>
                      $(function(){
                          var width ='{{round($st->chapter_num/$st->chapters,3)*100}}%' ;//获取百分比数值
                          $("#ress-co").css("width",width);//将数值赋值给main的width
                      });
                    </script>
					<span class="fr mr-10">完成度:</span>
					<div class="clearfix"></div>
				</div>
				<div style="height:16px;line-height: 16px;margin-top: 12px">
					<ul class="mem_bt">
        				<li class="ft-14 cor-4">评论数：<span>{{$st->comments_num}}</span></li>
        				<li class="ml-10 ft-14 cor-4" >积分：<span>{{$st->price}}</span></li>
        				<li class="ml-10 ft-14 cor-4">浏览次数：<span>{{$st->views_num}}</span></li>
        				<li class="ml-10 ft-14 cor-4">当前学习人数：<span>{{$st->studys_num}}</span></li>
        			</ul>
					<span class="fr ft-14 cor-4">{{$st->username}} 发表于{{date('Y-m-d',strtotime($st->ttime))}}</span>
					<div class="clearfix"></div>
				</div>
			</div>
			<div class="clearfix"></div>
		</div>
		@endforeach
		<div class="paginate">{!! $studys->render() !!} </div>
    </div>
</div>
@stop

<!-- 底部块 -->
@section('footer')
    @parent
@stop

